
/*

Design Pattern Automation Toolkit.
Application to create applications with emphasis on Design patterns.
And support for round trip engineering.
Copyright (C) 2004 Vineeth Neelakant. nvineeth@gmail.com

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.

*/
using System;
using BusinessLayer;
using InfoClasses;
using dpatoolkit.UILayer;
using System.Drawing;
using System.Windows.Forms;
using System.Collections;
namespace dpatoolkit.UILayer
{
    /// <summary>
    /// This interface should be inherited by the UI objects like classes , aggregate relations, etc
    /// </summary>
    public interface IUIObject
    {
        Point Location { get;set;}
        Rectangle BoundingRectangle { get;}
        bool Contains(Point p);

        bool IsDragging();
        void InitDrag(Point p);
        void Drag(Point pt, System.Windows.Forms.Control wnd);
        void EndDrag();
        bool CanDrag();

        void Draw(Graphics g);
        void DrawRelations(Graphics g);
        void DrawShadow(Graphics g);
        int GetUIXoffset(IUIRelation relation);
        int GetUIYoffset(IUIRelation relation);
        int GetIndex(IUIRelation relation);
        ArrayList Relations { get;}
        string GetIntellisenseInfo(Point p);
        /* returns the index of the ui relation */
        int AddUIPositionObserver(IUIRelation rel, UIPositionObserver del, bool isOwner);
        void RemoveUIPositionObserver(IUIRelation rel, UIPositionObserver del);
        bool RemoteObject { get;set;}
        //the uiobject checks if right click was done and
        //returns a ContextMenu object if was done.
        //else returns null.
        ContextMenu CheckRightClicked(Point p);
        string UIComponent { get;set;} // The actual ui component to which it belongs.
        string UIName { get;set;}//a name given for identification.
        bool ShowMinimal { get;set;}
        int TotalRelations { get;}
        void ComputeUIRecs(Graphics g);
        event UIPositionObserver UIPositionChanged;
    }
}
